<?
include("session.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/webkit/utils/jquery.js"></script>
<script type="text/javascript" src="/webkit/dialog/import.js"></script>
<script type="text/javascript" src="/webkit/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="/webkit/charts/import.js"></script>
<link type="text/css" rel="stylesheet" href="page.css"/>
<style>	input {vertical-align:middle} </style>
</head>
<body onload="show_report_charts()">

<table width=100% height=100% cellspacing=0 cellpadding=0>
	<tr>
	<td>
		<table width=100% height=100% id="chartsTable">
		<tr><td id="chartContainer1" height=50%></td></tr>
		<tr><td id="chartContainer2" height=50%></td></tr>
		</table>
	</td>
	</tr>
</table>

<script type="text/javascript">

	var dayReport = new FusionCharts("/webkit/charts/Column3D.swf", "dayReport", "100%", "100%", "0", "1"); 
	var timeReport = new FusionCharts("/webkit/charts/Line.swf",  "timeReport", "100%", "100%", "0", "1" );   
	   
	
	function show_report_charts() {
		$.get("report_query.php?action=day_call_report&task_id=<?echo $_GET['task_id']?>&user_id=<?echo $_GET['user_id']?>", function(data){
			eval("var json = "+data);
			dayReport.setJSONData(json);
			dayReport.render('chartContainer1');  
			show_time_report_by_date("<?echo date("Y-m-d")?>");
		});
	}

	function show_time_report_by_date(v){
		$.get("report_query.php?action=time_call_report&task_id=<?echo $_GET['task_id']?>&user_id=<?echo $_GET['user_id']?>&dt="+v, function(data){
			eval("var json = "+data);
			timeReport.setJSONData(json);
			timeReport.render('chartContainer2');  
		});
	}
</script>
</body>
</html>
